# 设置C++标准
project(config_test)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB_RECURSE SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cc")

file(GLOB_RECURSE HEADER 
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
message(STATUS "config test source: ${SOURCE}")
message(STATUS "config test header: ${HEADER}")

add_executable(config_test ${SOURCES})
target_include_directories(config_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(config_test PRIVATE ${CMAKE_SOURCE_DIR}/logger
${CMAKE_SOURCE_DIR}/config)

target_link_libraries(config_test PUBLIC config logger ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY} ${ZLIB_LIBRARY} ${OPENSSL_LIBRARIES} ${LIBEVENT_LIBRARIES} ${LIBEVENT_EXTRA_LIBRARIES} ${LIBEVENT_CORE_LIBRARIES} ${LIBEVENT_PTHREADS_LIBRARIES} ${LIBEVENT_OPENSSL_LIBRARIES} ${LIBEVENT_EXTRA_LIBRARIES} ${LIB})
# 添加测试
add_test(NAME config_test COMMAND config_test)